package com.yzy.fly.config;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yzy.fly.annotation.RoleChildren;
import com.yzy.fly.asm.annotation.FlyMapper;
import com.yzy.fly.kernel.model.FlyBasicModel;
import com.yzy.fly.util.DateUtil;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@FlyMapper(ds = "fly")
@Data
@TableName(value = "fly_transaction")
public class FlyTransaction extends FlyBasicModel<Long, FlyTransaction> {

    @TableId(type = IdType.AUTO)
    private Long id;

    private String annType;
    private String pkgName;
    private String clsName;
    private String methodName;
    private String startupId;
    private String appId;

    @DateTimeFormat(pattern = DateUtil.DateFormatPattern.yyyy_MM_dd_HH_mm_ss)
    @JsonFormat(pattern = DateUtil.DateFormatPattern.yyyy_MM_dd_HH_mm_ss)
    @JSONField(format = DateUtil.DateFormatPattern.yyyy_MM_dd_HH_mm_ss)
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    @DateTimeFormat(pattern = DateUtil.DateFormatPattern.yyyy_MM_dd_HH_mm_ss)
    @JsonFormat(pattern = DateUtil.DateFormatPattern.yyyy_MM_dd_HH_mm_ss)
    @JSONField(format = DateUtil.DateFormatPattern.yyyy_MM_dd_HH_mm_ss)
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    @RoleChildren
    private FlyTransactionAttribute attribute;

}